package com.evon.yardmanagement.model;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "YARD_MAPPING")
@AttributeOverride(name = "id", column = @Column(name = "ID"))
public class YardMapping extends BaseModel implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="COMPANY_ID")
	private Vendor vendor;
	
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="OEM_ID")
	private Oem oem;
	
	
	@Column(name="YARD_ID")
	private Integer yardId;
	
	@OneToOne
	@JoinColumn(name="YARD_ID", insertable=false, updatable=false)
	
	private Yard yard;
	
	public Yard getYard() {
		return yard;
	}

	public void setYard(Yard yard) {
		this.yard = yard;
	}

	@Column(name = "ACTIVE")
	private Integer active;

	public Vendor getVendor() {
		return vendor;
	}

	public void setVendor(Vendor vendor) {
		this.vendor = vendor;
	}

	public Oem getOem() {
		return oem;
	}

	public void setOem(Oem oem) {
		this.oem = oem;
	}

	

	public Integer getYardId() {
		return yardId;
	}

	public void setYardId(Integer yardId) {
		this.yardId = yardId;
	}

	public Integer getActive() {
		return active;
	}

	public void setActive(Integer active) {
		this.active = active;
	}
	
	

}
